<div id="<?php echo $uniqid;?>" style="padding:5px">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="15%" >回复内容：</td>
            <td width="85%" ><textarea style="width: 320px; height: 80px;"
                       class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                       placeholder="请输入名称.."  v-model="params.content"></textarea>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >图片：</td>
            <td class="main">
                <div title="上传图片" style="display: flex; height: 80px; overflow: hidden;">
                    <div class="img-box" v-if="params.images.length>0" v-for="(vo,index) in params.images">
                        <a class="linkWrapper" target="_blank" :href="vo" title="查看原图">
                            <img height="70px" :src="vo+'?imageView2/1/w/100/h/100'"></a>
                        <div class="img-box-del" @click="deleteImages(index)">
                            <img class="label-auto" src="/static/Easyui/themes/2019/icons/del_tr.gif">
                        </div>
                    </div>
                    <div class="add-image-button">
                        <a class="btn btn-default btn-lg" @click="uploadBox('replyVm.params.images')" href="javascript:void(0);">
                            <i class="iconfont icon-tianjia"></i>
                        </a>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</div>
<script>
    var replyVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: {
                id: '<?php echo $id;?>',
                content: '',
                images: []
            },
        },
        mounted() {
            this.init();
        },
        methods: {
            init(){
            },
            deleteImages(index){
                this.params.images.splice(index, 1);
            },
            submit(){
                replyVm.params.pid = $('#<?php echo $uniqid;?> .item-pid').val();
                $.post('/merchant/orderaftersale/reply', replyVm.params, function (data) {
                    if (parseInt(data.ret) === 0) {
                        orderaftersaleVm.init();
                        orderaftersaleeditVm.params.logs.unshift(data.data);
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $("#orderaftersaleeditdlg").dialog('close');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            }
        }
    });
    $(function () {
        $('#replysubmit').click(function () {
            replyVm.submit();
        });
    });
</script>
